
import React from 'react'

//广告投放
export const facilityMessage=(Type,Name,Color,Data)=>{
	return{
    legend: {
        orient: 'horizontal',
        x: 'left',
        left:15,
        data:Name,
    },
    series: [
      {
        name:Type,
        type:'pie',
        selectedMode: 'single',
        radius: [0, '30%'],
				center: ['50%', '50%'],
        label: {
            normal: {
                position: 'inner'
            }
        },
        labelLine: {
            normal: {
                show: false
            }
        },
        data:[
            {value:335, name:Name[3],selected:true,
            	itemStyle:{
            		normal:{color:Color[0]}
           	 }},
            {value:679, name:Name[4],itemStyle:{
            		normal:{color:Color[3]}
           	 }},
        ]
      },
      {
        name:Type,
        type:'pie',
        radius: ['40%', '55%'],
        center: ['50%', '50%'],
        label: {
          normal: {
            formatter: ' {per|{d}%}  ',
            rich: {
                b: {
                    fontSize: 14,
                    lineHeight: 25
                },
                per: {
                    color: '#eee',
                    backgroundColor: 'transparency',
                    padding: [2, 4],
                }
              }
            }
          },
          data:[
              {value:335, name:Name[0]},
              {value:310, name:Name[1]},
              {value:234, name:Name[2]}
          ],
          color:[Color[0],Color[1],Color[2]]
      }
    ]
	}
}

//设备APK版本
export const facilityApk=(Type,Name,Color,Data)=>{
	return{
		tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b}: {c} ({d}%)"
    },
    legend: {
        orient: 'horizontal',
        align: 'left',
        data:Name,
    },
    series: [
      {
        name:Type,
        type:'pie',
        selectedMode: 'single',
        radius: [0, '30%'],
				center: ['50%', '50%'],
        label: {
            normal: {
                position: 'inner'
            }
        },
        labelLine: {
            normal: {
                show: false
            }
        },
        data:[
            {value:335, name:Name[3], selected:true,
            	itemStyle:{
            		normal:{color:Color[0]}
           	 }},
            {value:679, name:Name[4],itemStyle:{
            		normal:{color:Color[3]}
           	 }},
           	 {value:679, name:Name[5],itemStyle:{
            		normal:{color:Color[4]}
           	 }},
        ]
      },
      {
        name:Type,
        type:'pie',
        radius: ['40%', '55%'],
        center: ['50%', '50%'],
        label: {
          normal: {
            formatter: ' {d}%}  ',
            rich: {
                b: {
                    fontSize: 14,
                    lineHeight: 33
                },
                per: {
                    color: '#eee',
                    backgroundColor: 'transparency',
                    padding: [2, 4],
                }
              }
            }
          },
          data:[
              {value:335, name:Name[0]},
              {value:310, name:Name[1]},
              {value:234, name:Name[2]}
          ],
          color:[Color[0],Color[1],Color[2]]
      }
    ]
	}
}


//设备投放准确度
export const putAccuracy=()=>{
	return{
    legend: {
        data:['刊播准确度','投放准确度'],
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis : [
        {
          type : 'category',
          boundaryGap : false,
          data : ['t-1','t-2','t-3','t-4','t-5','t-6','t-7'],
        }],
    yAxis : [
        {
          type : 'value',
          axisPointer:{
          	show:true,
          	label:{
          		formatter:"{value}%"
          	}
          }
        }],
    series : [
      {
        name:'刊播准确度',
        type:'line',
        stack: '总量',
        label: {
        			formatter: ' {per|{d}%}  ',
	            normal: {
	                show: true
	               
	            }
	       },
        data:[120, 132, 101, 134, 90, 230, 210],
        itemStyle:{
        	normal:{color:"rgb(144,217,231)"}
        }
      },
      {
        name:'投放准确度',
        type:'line',
        stack: '总量',
        label: {
              normal: {
                  show: true,
                  position: 'inside'
              }
          },
        data:[220, 182, 191, 234, 290, 330, 310],
        itemStyle:{
        	normal:{color:"rgb(192,234,242)"}
        }
      }]
	}
}


//设备价值

export const  FacilityCost=()=>{
	
	return{
		grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis : [
        {
          type : 'category',
          data : ['成都','杭州','北京','上海','连云港','广州','南京','大连','重庆','昆明'],
          
        }],
    yAxis : [
        {
          type : 'value',
         	axisPointer:{
          	show:true,
          	label:{
          		formatter:"{value}"
          	}
          }
        }],
    series : [
      {
        name:'刊播准确度',
        type:'bar',
        stack: '总量',
        data:[120, 132, 101, 134, 90, 230, 210,300,120,190],
        itemStyle:{
        	normal:{color:"rgb(144,217,231)"}
        }
      }]
	}
}
